class_name Sundry
extends Node



# 根据group查找球，若在_ready中使用时，需要确保Ball已经挂载
static func find_ball(tree: SceneTree) -> Ball:
	var node := tree.get_first_node_in_group(GlobalConstants.GROUP_BALL)
	return node as Ball


# 根据group查找球门，若在_ready中使用时，需要确保Goal已经挂载
static func find_goals(tree: SceneTree) -> Dictionary[Goal.GoalLocation, Goal]:
	var nodes := tree.get_nodes_in_group(GlobalConstants.GROUP_GOAL)
	var goals: Dictionary[Goal.GoalLocation, Goal] = {}
	for node in nodes:
		var goal := node as Goal
		goals[goal.goal_location] = goal
	return goals
